<script setup>
import { ssoApi } from '@/api/user'
import { useRoute } from 'vue-router'
import { setToken } from '@/utils/auth.js'
const vueRouter = useRouter()

const route = useRoute()
const { access_token } = route.query
if (access_token) {
  ssoApi(access_token).then((res) => {
    setToken(res.data)
    vueRouter.push({ path: '/' }).catch(() => {})
  })
} else {
  vueRouter.push({ path: '/login' }).catch(() => {})
}
</script>
<template>
  <div></div>
</template>
